<%= render :partial => 'admin/shared/product_sub_menu' %>

<%= render :partial => 'admin/shared/product_tabs', :locals => {:current => "Product Properties"} %>

<%= error_messages_for :product %>

<% form_for(:product, :url => admin_product_url(@product), :html => { :method => :put }) do |f| %>
  <table class="index">
    <thead>
      <tr>
        <th><%= t("property") %></th>
        <th><%= t("value") %></th>
        <th><%= t("action") %></th>
      </tr>
    </thead>
    <tbody id="product_properties">
  		<%= f.render_associated_form(@product.product_properties) %>
  		<tr id="none">
  		  <td colspan="3"><%= @product.product_properties.empty? ? "#{t("none")}." : "" %></td>
  		</tr>
  	</tbody>
  </table>

  <input type="hidden" name="clear_product_properties" value="true">

  <p>
    <%= f.add_associated_link(icon('add') + ' ' + t("add_product_properties"), @product.product_properties.build, 
                              {:onclick => "Element.hide('none');", :class => 'iconlink'}) %>
    &nbsp;&nbsp;
  	<span id="new_ptype_link">
  	  <%= link_to_remote t("select_from_prototype"), 
  	                     :url => available_admin_prototypes_url, 
  	                     :method => :get,
  	                     :update => "prototypes",
  	                     :before => "Element.hide('new_ptype_link');Element.show('busy_indicator')", 
  	                     :complete => "Element.hide('busy_indicator')" %>
  	</span>
	</p>
	<div id="prototypes"></div>
	<%= image_tag "spinner.gif", :plugin=>"spree", :style => "display:none", :id => 'busy_indicator' %>
	<br/>
  <%= render :partial => 'admin/shared/edit_resource_links' %>
<% end %>

